
const mongoose = require('mongoose')
const config = require('./config')

module.exports = () => {
  // 连接数据库
  let db = mongoose.connect(config.mongodb, { useNewUrlParser: true, useUnifiedTopology: true })
  require('../DBmodels/user')
  require('../DBmodels/project')
  require('../DBmodels/errorReport')
  return db
}
